<!DOCTYPE HTML>
<html lang="zh-CN"><head>
<title>晒单</title>
<meta charset="UTF-8">
<meta name="viewport" content=" initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<link href="{$Think.config.RESOURCEURL}wx_assets/bootstrap/bootstrap.min.css" rel="stylesheet">
<link href="{$Think.config.RESOURCEURL}wx_assets/css/common.css{$Think.config.RESOURCE_VER}" rel="stylesheet">
<link href="{$Think.config.RESOURCEURL}wx_assets/css/product/evaluation.css{$Think.config.RESOURCE_VER}" rel="stylesheet">
<link href="{$Think.config.RESOURCEURL}wx_assets/indiana/style.css" rel="stylesheet">
<script type="text/javascript" src="{$Think.config.RESOURCEURL}wx_assets/js/zepto.1.1.3.min.js{$Think.config.RESOURCE_VER}"></script>
<script type="text/javascript" src="{$Think.config.RESOURCEURL}wx_assets/js/zepto.alert.js{$Think.config.RESOURCE_VER}"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript" src="{$Think.config.RESOURCEURL}wx_assets/js/wx_share_byhyj.js{$Think.config.RESOURCE_VER}"></script>
<script src="{$Think.config.RESOURCEURL}wx_assets/js/util.js{$Think.config.RESOURCE_VER}" type="text/javascript"></script>
</head>
<style>
	@font-face {
	  font-family: 'iconfont';
	  src: url('//at.alicdn.com/t/font_1460724376_8388903.eot'); /* IE9*/
	  src: url('//at.alicdn.com/t/font_1460724376_8388903.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
	  url('//at.alicdn.com/t/font_1460724376_8388903.woff') format('woff'), /* chrome、firefox */
	  url('//at.alicdn.com/t/font_1460724376_8388903.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/
	  url('//at.alicdn.com/t/font_1460724376_8388903.svg#iconfont') format('svg'); /* iOS 4.1- */
	}            
	.media-left img
	{
		width: 64px;
	}
	.media-heading
	{
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		max-height: 40px;
		overflow: hidden;
		
		font-size: 15px;
	}
	.upload-img
	{
		margin:20px auto;
		font-size: 15px;
		
	}
	.release
	{
		width: 100%;
		display: block;
		line-height: 45px;
		font-size: 18px;
		color: white;
		background: #f75493;
		margin-top: 30px;
		text-align: center;
		border-radius: 4px;
	}
	.upload-img > span
	{
		vertical-align: top;
	}
	.upload-list
	{
		display: inline-block;
		overflow: hidden;
	}
	.upload-list > div
	{
		float: left;
		margin-right: 8px;
		width: 60px;
		height: 60px;
		text-align: center;
		line-height: 60px;
		color: white;
		background: #ddd;
		position: relative;
		overflow: hidden;
	}
	.upload-list > div > img
	{
		max-width: 100%;
		position: absolute;
		top: 50%;
		left: 50%;
		-webkit-transform: translate(-50%,-50%);
		display: none;
	}
	.release.disabled{
		background-color:#ccc;
		color:white;
	}
</style>
<body>
<div class="evaluation">
    <!--<dl class="productInfo" onclick="comment.onDetail('{$fromCustomerId}','{$pid}','{$qId}','{$miUid}')">
        <dt><img src="{$picUrl}" onload="$.util.imgCenter(this)"></dt>
        <dd>
            <div class="title">
            {$name}
            </div>
            <div class="grayfont">
                <if condition="$sizeName neq ''">
                    规格：{$sizeName}
                    <if condition="$colorName neq ''">
                    ,{$colorName}
                    </if>
                    &nbsp;数量：{$count}
                <else/>
                数量：{$count}
                </if>
            </div>
        </dd>
    </dl>-->
    <div class="media" onclick="comment.onDetail('{$fromCustomerId}','{$pid}','{$qId}','{$miUid}')">
		  <div class="media-left">
		      <img class="media-object" src="{$picUrl}" onload="$.util.imgCenter(this)">
		  </div>
		  <div class="media-body" style="vertical-align: middle;">
		    <h2 class="media-heading">{$name}</h2>
		    
		  </div>
	</div>
    <!--<div class="order-num">订单编号：<span class="grayfont">1823471783747813</span></div>-->
    <div class="upload-img" >
    	<span>请上传照片：</span>
    	<div class="upload-list" data-mid="">
    		<div class="choosImg">
    			<i class="iconfont">&#xe60b;</i>
    			<img src=""/>
    		</div>
    		<div class="choosImg">
    			<i class="iconfont">&#xe60b;</i>
    			<img src=""/>
    		</div>
    		<div class="choosImg">
    			<i class="iconfont">&#xe60b;</i>
    			<img src=""/>
    		</div>
    	</div>
    </div>
	<if condition="$commentType neq '1'">
		<div class="textDiv">
			<textarea placeholder="说说你的想法吧，小伙伴们都很期待。" maxlength="200" id="comment"></textarea>
		</div>
	</if>
    <!--<div class="menu">
        <a class="release" id="release" onclick="comment.save()">发布</a>
        <a class="cancel" id="cancelBtn" onclick="comment.toOrder()">取消</a>
    </div>-->
    <a onclick="comment.save()" class="release">提交</a>
</div>
<script type="text/javascript">

var imgs='';
var baseUrl = '{$Think.config.SERVER_HOST}';
    var comment={
        save:function(){
            var comment=$.trim($("#comment").val());
            if('{$commentType}'!=1&&!comment){
                $.util.alert("请输入评论内容");
                return;
            }
            if(!imgs){
                $.util.alert("至少上传一张图片!");
                return;
			}
            var p=$.util.getParamAsObject();
            var me=this;
            $.req.post("call.json?customerId={$customerId}&userName={$fromUserName}",{
                "module":"product",
                "method":"saveComment",
                params:{
                    "comment":$("#comment").val(),
                    "oid":"{$oid}",
                    "pid":"{$pid}",
                    "imgs":imgs,
					"type":p.type
                }
            },function(data){
               	if('{$commentType}'==1){
                    var params = {
                        "oid":p.oid,
                        "uType":p.uType
                    };
                    params=encodeURIComponent(JSON.stringify(params));
                    location.href = '{$Think.config.SERVER_HOST}call.html?customerId={$platCustomerId}&module=quan&method=getOrderDetail&params='+params;
				}else{
                   var params = {
					   "id":p.oid,
					   "tplid":1
				   };
                    params=encodeURIComponent(JSON.stringify(params));
                    location.href = '{$Think.config.SERVER_HOST}call.html?customerId={$customerId}&module=product&method=getOrderDetail&force=1&params='+params;
				}
            });
        },
        onDetail:function(fromCustomerId,id,qId,miUid) {
            var params={
                "id":id,
                "qId":qId,
                "miUId":miUid
            }
            params=encodeURIComponent(JSON.stringify(params));
            location.href= 'call.html?customerId='+fromCustomerId+'&module=product&method=getProduct&params='+params;
        },

        toOrder:function(){
               var params={
                   "tplid":1,
                   "type":"buy,point"
               }
               params=encodeURIComponent(JSON.stringify(params));
               location.href= 'call.html?customerId={$customerId}&module=product&method=getOrder&params='+params;
//          window.location.href=document.referrer;
        }
    }
wx_share.init({
	"title":"",
    "desc":'',
    "link":'',
    "imgUrl":"{$picUrl}",
    "pkg":{
        "appId": '{$pkg.appId}',
        "timestamp": {$pkg.timestamp},
        "nonceStr": '{$pkg.nonceStr}',
        "signature": '{$pkg.signature}'
    }
});
$('.upload-list > div').on('click',function(){
	
	var thisImg=$(this).find('img'),
		_this=this;
	if($(this).hasClass('choosImg'))
	{
		wx_share.uploadImage(function(data){
		thisImg.attr('src',data.path).show();
		$(_this).removeClass('choosImg');
		if(imgs=='')
		{
			imgs=data.path;
		}
		else
		{
			imgs=imgs+','+data.path;
		}
		
//		alert('显示：'+data.path);
		});
	}
	
});
</script>
</body>
</html>
